
public class Sender {

	private String name;

	protected Sender(String name) {
		super();
		this.name = name;
	}

	public Command newCommand(String msg) {
		System.out.println(name + "发布一条消息");
		return new MyCommand(this, msg);
	}
	
	public void receive(){
		System.out.println(name + "收到回复，辛苦了");
	}
	
	public String getName(){
		return name;
	}
}
